const TOKEN_KEY = 'geek-pc-8-11'

/**
 * 保存token
 * @param {*} token 
 * @returns 
 */

export const setToken = (token) => localStorage.setItem(TOKEN_KEY, token)

/**
 * 获取token
 * @param {*} token 
 * @returns 
 */

export const getToken = (token) => localStorage.getItem(TOKEN_KEY, token)

/**
 * 
 * @returns 移出token
 */

export const removeToken = () => localStorage.removeItem(TOKEN_KEY)

/**
 * 判断是否有token
 * @returns 
 */

export const hasToken = () => !!getToken()